﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace modul3
{
    /// <summary>
    /// systemovy index
    /// obsahujezoznm vsetkych indexov
    /// </summary>
    class cSystemIndex
    {
        public class cMyIndex
        {
            private string psNazov;
            /// <summary>
            /// Nazov indexu
            /// </summary>
            public string sNazov
            {
                get { return psNazov; }
                set { psNazov = value; }
            }

            private kkIndexType pkTyp;
            /// <summary>
            /// Typ indexu Bitmap index, Dense index, Sparse index
            /// </summary>
            public kkIndexType kTyp
            {
                get { return pkTyp; }
                set { pkTyp = value; }
            }

            private int piTabulka;
            /// <summary>
            /// Cislo indexu
            /// </summary>
            public int iTabulka
            {
                get { return piTabulka; }
                set { piTabulka = value; }
            }

            private bool pbUnique;
            public bool bUnique
            {
                get { return pbUnique; }
                set { pbUnique = value; }
            }

            private List<int> paColumns;
            /// <summary>
            /// cisla stlpcov na ktorych je index
            /// </summary>
            public List<int> aColumns
            {
                get { return paColumns; }
                set { paColumns = value; }
            }
        }

        private List<cMyIndex> paIndexy;
        /// <summary>
        /// zoznam uplne vsetkych indexov
        /// </summary>
        internal List<cMyIndex> aIndexy
        {
            get { return paIndexy; }
            set { paIndexy = value; }
        }


        /// <summary>
        /// vytvori index
        /// </summary>
        /// <param name="pa_sNazov">nazov indexu</param>
        /// <param name="pa_kTyp">typ indexu</param>
        /// <param name="pa_bUnique">unikatny index</param>
        /// <param name="pa_aColumns">List(int) obsahujuci cisla stlpcov </param>
        /// <returns></returns>
        public bool CreateIdx(string pa_sNazov, kkIndexType pa_kTyp, bool pa_bUnique, List<int> pa_aColumns)
        {
            return false;
        }

        /// <summary>
        /// zrusi konkretny index
        /// </summary>
        /// <param name="pa_cRusenyIndex">ruseny index</param>
        /// <returns>bool, ci bol index zruseny</returns>
        public bool DropIdx(cMyIndex pa_cRusenyIndex)
        {
            return false;
        }

        /// <summary>
        /// zisti, ci existuje nejaky index nad stlpcom
        /// </summary>
        /// <param name="pa_iColumn">id stlpca, ktory zistujeme</param>
        /// <returns></returns>
        public bool IsInIdx(int pa_iColumn)
        {
            return false;
        }

        /// <summary>
        /// vrati indexy daneho stlpca
        /// </summary>
        /// <returns></returns>
        public List<cMyIndex> ListIdx()
        {
            return null;
        }
    }
}
